﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KTool2.Utility
{
    class RandomGenerator
    {
        private static Random rand;
        private static object syncObj = new object();

        public static int NextInt(int minValue, int maxValue)
        {
            lock (syncObj)
            {
                if (rand == null)
                {
                    rand = new Random();
                }
                
                return rand.Next(minValue, maxValue);
            }
        }
    }
}
